Some conventional hand-held game apparatuses are each provided with a gyro sensor. In such a hand-held game apparatus, when the game apparatus is moved by a user, a rotation angle based on the movement by the user is detected by using the gyro sensor. A virtual camera in a virtual space is moved in accordance with the detected rotation angle, and an image of a virtual object or the like in the virtual space is taken by the virtual camera, thereby generating an image. Thus, in the above game apparatus, a position of the virtual camera is moved by moving the game apparatus, and the virtual object viewed from various points of view can be displayed.
The above game apparatus controls the virtual camera only by using the gyro sensor.
The present application discloses a storage medium having stored therein an image generation program, an image generation method, an image generation apparatus, and an image generation system which are capable of improving operability.
The exemplary image generation program stored in the computer-readable storage medium according to the present application is executed by a computer of a display device including a display unit. The image generation program causes the computer to execute: moving an object in a virtual space based on an operation performed by a user; setting a virtual camera in the virtual space based on at least one of a position, an orientation, and a travelling direction of the moved object in the virtual space; activating, based on a predetermined activation operation performed by the user, camera control for controlling an orientation of the virtual stereo camera in accordance with an orientation of the display device; and generating an image to be displayed on the display unit by: when the camera control is activated, changing the set orientation of the virtual camera in accordance with the orientation of the display device and capturing the virtual space by using the virtual camera whose orientation has been changed; and when the camera control is not activated, capturing virtual space by using the virtual camera set based on at least one of the position, the orientation, and the travelling direction of the moved object.
According to the above exemplary configuration, the virtual camera is set based on at least one of the position, the orientation, and the travelling direction of the object. Consequently, the virtual camera can be set at an appropriate position while moving the object in accordance with the user's operation. Furthermore, because the virtual camera can be moved in accordance with the orientation of the display device by the user performing the predetermined activation operation, the user can move the object while looking around in the virtual space, for example. Thereby, a variety of operations can be performed.
In another exemplary configuration, when the camera control is activated, the orientation of the virtual camera may be changed, based on a change amount of the orientation of the display device from a reference orientation which is the orientation of the display device when the camera control is activated.
According to the above exemplary configuration, the virtual camera is controlled based on the change amount from the reference orientation which is a position of the display device when the activation operation is performed by the user. Consequently, in a case where the user performs the activation operation after the orientation of the virtual stereo camera is changed, the virtual camera can be prevented from moving suddenly.
In another exemplary configuration, when the camera control is switched from an active state to an inactive state, the orientation of the virtual camera set based on at least one of the position, the orientation, and the travelling direction of the moved object may be used unchanged irrespective of the orientation of the display device when the camera control is inactivated.
In another exemplary configuration, the virtual camera may be set so that the object is included in its viewing range.
According to the above exemplary configuration, when the camera control is inactivated, the image captured by using the set virtual camera is displayed on the display unit. In a case where the user happens to change the orientation of the virtual camera greatly and desires to return the virtual camera to its original state, the user only has to cancel the activation operation. Thus, the virtual camera can be returned to its normal state by a simple operation. Further, if the virtual camera is set so that the object is included in its viewing range, the object can be displayed on the display unit by inactivating the camera control.
According to the above, a storage medium having stored therein an image generation program, an image generation method, an image generation apparatus, and an image generation system which are capable of improving operability can be provided.
These and other objects, features, aspects and advantages will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.